<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="content-type" content="text/html;charset=utf-8">
    <%@include file="/views/common/include/taglib.jsp"%>
    <%@include file="/views/common/include/head.jsp"%>
    <link rel="stylesheet" href="${ctx}/css/page/yhq.css" type="text/css">
	<link rel="stylesheet" href="${ctx}/css/page/reset.css" type="text/css">
	<link rel="stylesheet" href="${ctx}/css/page/page.css" type="text/css">
	<link rel="stylesheet" href="${ctx}/css/page/header2.css" type="text/css">
	<link rel="stylesheet" href="${ctx}/css/page/person-left.css" type="text/css">
	<link rel="stylesheet" href="${ctx}/css/page/footer.css" type="text/css">
	<script type="text/javascript">
		var ctx = '${ctx}';
		
		function changeState(state){
			window.location.href = ctx +"/ownerTreasure/ownerIntegralChangeList?pNo=1"+ "&state=" + state;
		}
		
		var page = 1;	
	    //跳转到优惠券的列表页面
	    function gotoPage(page) {
	    	var pages = $("#pages").val();
	    	if(page == null || page == 'undefined'){
	    		page = this.page;
	    	}
	    	if(page < 1 ){
	    		layer.msg("已到达第一页!", {
					time : 2000
				// 2秒关闭（如果不配置，默认是3秒）
				});
	    	} else if(page > pages){
	    		layer.msg("已到达最后一页!", {
					time : 1000
				// 2秒关闭（如果不配置，默认是3秒）
				});
	    	} else {
			window.location.href = ctx +"/ownerTreasure/getCouponList?pNo=" + page;
	    	}
		}
	</script>	
</head>
<body>
	<jsp:include page="/views/common/head_main.jsp" />
	<div class="bg">
		<div class="contentbox1 contentbox">
			<div class="leftlist">
		        <div class="myorder left">
					<ul>
						<li><a class="order" href="${ctx}/orderInfo/orderInfoListByState" >我的订单</a></li>
						<li><a href="${ctx}/orderInfo/orderInfoListByState?states=0">待付款</a></li>
						<li><a href="${ctx}/orderInfo/orderInfoListByState?states=1">待商家确认</a></li>
						<li><a href="${ctx}/orderInfo/orderInfoListByState?states=2">待发货</a></li>
						<li><a href="${ctx}/orderInfo/orderInfoListByState?states=3,14">待收货</a></li>
						<li><a href="${ctx}/orderInfo/orderInfoListByState?states=6,7,8,10,11,12,13">退款售后</a></li>
					</ul>
				</div>
				<div class="myproperty left">
					<ul>
						<li class="order">我的物业</li>
						<c:if test="${displayFeeBill == 1}">
						<li><a href="${ctx}/propertyBill/getMyBill">我的物业费</a></li>
						</c:if>
						<c:if test="${displayCar == 1}">
						<li><a href="${ctx}/carBill/getCarManage">我的停车费</a></li>
						</c:if>
						<li><a href="${ctx}/propertyRepair/infoList">我的物业报修</a></li>
						<li><a href="${ctx}/propertySuggestion/infoList">我的物业投诉</a></li>
					</ul>
				</div>
				<div class="myassets left">
					<ul>
						<li class="order">我的资产</li>
					    <li><a  href="${ctx}/ownerTreasure/ownerIntegralChangeList?state=0&pNo=1">我的积分</a></li>
						<li><a style="color:red;" href="${ctx}/ownerTreasure/getCouponList?pNo=1">优惠券</a></li>
					</ul>
				</div>
				<div class="otherlist left">
					<ul class="others">
						<li class="order">其他</li>
						<li><a  href="${ctx}/ownerOther/getMyCollection">我的收藏</a></li>
						<li><a  href="${ctx}/ownerAddress/ownerAddressList">我的收货地址</a></li>
						<li><a href="${ctx}/complaintsInfo/infoList">我的投诉建议</a></li>
						<li><a href="${ctx}/ownerHouse/ownerHouseList">我的小区</a></li>
						<!-- position需要跳转到特定位置 -->
						<li><a href="${ctx}/main?item=1#openShop">我要开店</a></li>
						<li><a href="${ctx}/usualQuestions/infoList">常见问题</a></li>
					</ul>
				</div>
			</div>
			<%-- <jsp:include page="/views/main/main_personal_left.jsp" /> --%>
			<div class="rightlist">
			<input type="hidden" id="item" value="${sessionScope.item_personal}"/>
				<div class="rightbox">
                	<h3 class="title">我的优惠券</h3><hr class="line">
					<%-- <div class="ordercon">
						<c:forEach items="${record.list}" var="item" varStatus="status">
							<div style="float:left;padding:15px;height:100px;width:30%;">
								<c:if test="${item.couponState == 1}">未过期</c:if>
								<c:if test="${item.couponState == 2}">已过期</c:if>
								<span>${item.name}</span>
								<span>${item.useBeginDate}---${item.useEndDate}</span>
								<span>满${item.breakLine}减 ${item.breakPrice}</span>
							</div>
						</c:forEach>
					</div> --%>
					<div class="yhq-list">
						<c:forEach items="${record.list}" var="item" varStatus="status">
							<div class="yhq">
								<c:if test="${item.couponState == 1}">
									<c:if test="${status.index %2 == 0}">
										<img class="img-style" src="${ctx}/images/page/y1.jpg"/>
									</c:if>
									<c:if test="${status.index %2 != 0}">
										<img class="img-style" src="${ctx}/images/page/y2.png"/>
									</c:if>
								</c:if>
								<c:if test="${item.couponState == 2}">
									<img class="img-style" src="${ctx}/images/page/y3.png"/>
								</c:if>
								<div class="datebox">
									<p style="font-weight:900;">
										<c:if test="${item.shopName == null}">D生活平台券</c:if>
										<c:if test="${item.shopName != null}">${item.shopName}优惠券</c:if>
									</p>
									<p>使用期限：${item.useBeginDate}-${item.useEndDate}</p>
								</div>
								<div class="price-box">
									<div class="price">
										${item.breakPrice}
									</div>
									<div class="r-box">
										<p>RMB</p>
										<p>满${item.breakLine}使用</p>
									</div>
								</div>
							</div>
						</c:forEach>
					</div>
				</div>
				<div class="page">
					<input id="pages" type="hidden" value="${record.pages}">
					<ul>
						<li><a class="last-page page-change " onclick="gotoPage(${currentPage-1 });">&lt;上一页</a></li>
						<c:if test="${record.firstPage > 1}">
							<li onclick="gotoPage(1);"
								class="page-num"><a>1</a></li>
							<c:if test="${record.firstPage > 2}">
                       		...
                       		</c:if>
						</c:if>
						<c:forEach items="${record.navigatepageNums }" var="page">
							<li onclick="gotoPage(${page });"
								class="<c:if test="${currentPage == page }">current</c:if>"
								class="page-num"><a>${page}</a></li>
						</c:forEach>
						<c:if test="${record.lastPage < record.pages}">
							<c:if test="${record.firstPage < record.pages - 1}">
                       		...
                       		</c:if>
							<li onclick="gotoPage(${record.pages});"
								class="page-num"><a>${record.pages}</a>
							</li>
						</c:if>
						<li><a class="next-page page-change" onclick="gotoPage(${currentPage+1 });">下一页&gt;</a></li>
					</ul>
				</div>
			</div>
		</div>
	</div>
	<jsp:include page="/views/common/footer.jsp" />
</body>
</html>